<?php 

$url = "http://".$_SERVER['HTTP_HOST'];
define("__url__", $url);

class Consts{
	
	
	
	//该方法有bug
	public static function getProjectURL(){
		$url = $_SERVER['REQUEST_URI'];
		//$url = explode("/", $url);
		return $url;
	}
	
	public static function getHeader(){
		$url = $_SERVER['HTTP_USER_AGENT'];
		return $url;
	}
	
	public static function getHost(){
		$url = "http://".$_SERVER['HTTP_HOST'];
		return $url;
	}
	
	public static function getRealPath(){
		$url = $_SERVER['DOCUMENT_ROOT'].$_SERVER['REQUEST_URI'];
		return $url;
	}
	
	public static function getRequestURL(){
		$url = $_SERVER['REQUEST_URI'];
		$url = explode("/", $url);
		if (count($url)%2==0){
			array_shift($url);
			array_shift($url);
		}else{
			array_shift($url);
		}
		return $url;
	}
}
